import React from 'react';
import { Button } from 'antd';
import { RunBy, stringForRunBy } from '@/reducers/state';

export type ResourceNotLoadedProps = {
    name: string;
    from: RunBy;
    showList: Function;
};

export function ResourceNotLoaded(props: ResourceNotLoadedProps) {
    return (
        <div className='list-not-loaded'>
            <p>通过{stringForRunBy(props.from)}启动</p>
            <p>{props.name}未加载</p>
            <Button
                type='primary'
                onClick={props.showList as any}
            >
                立即加载
            </Button>
        </div>
    );
}
